#define createNavTreeView(treeView, baseUrl, currentPath)

    #for(treeNode : treeView)
        #set(children = treeNode.getChildren())
        #set(title = treeNode.getTitle())
        #set(icon = treeNode.getIcon())
        #set(type = treeNode.getType())
        #set(action = treeNode.getAction())
        #set(isActive = (currentPath == action))
        #set(isOpen = false)

        #for(item : children)
            #if(item.action == currentPath)
                #set(isOpen = true)
                #break
            #end
        #end

        #if(type == 'DIR')
            <li class="layui-nav-item #(isOpen ? "layui-nav-itemed" : "")">
                <a class="" href="javascript:;"><i class="iconfont #(icon)"></i>&nbsp;&nbsp;#(title)</a>
                <dl class="layui-nav-child">
                    #@createNavTreeView(children, baseUrl, currentPath)
                </dl>
            </li>
        #elseif (type == 'LINK')
            <dd #(isActive ? "class=\"layui-this\"" : "")><a href="#(action)"><i class="iconfont #(icon)"></i>&nbsp;&nbsp;#(title)</a></dd>
        #end
    #end

#end
